<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 0<=x<1 的随机数
        console.log(Math.random());

        // 两个数之间的随机整数，且饱含这两个数
        function getRandom(min, max) {
            return Math.floor(Math.random() * (max - min + 1)) + min;
        }

        console.log(getRandom(1, 10));

        var arr = ['张三', '张三丰', '张三疯子', '李四', '李思思'];

        console.log(arr[getRandom(0, arr.length - 1)]);
    </script>
</head>

<body>

</body>

</html>